#ifndef MF_ABSTRACT_HEADER
#define MF_ABSTRACT_HEADER
#include<string>
#include<fstream>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<iterator>
#include<vector>
#include<tuple>
#include<map>
#include<set>
#include<cstdlib>
#include<ctime>
#include<unordered_map>
#include<tuple>
#include<algorithm>
#include "def.hpp"

using namespace std;

namespace Puza {
	class PuzaLFM {
	protected:
		virtual double Hypothesis(PuzaRow r); // this is the hypothesis for an individual row
		virtual double PointwiseLossFunction(double y_bar, double y);
		virtual double RankwiseLossFunction(double y1, double y2);
		virtual void PointwiseSGD(double y_bar, PuzaRow r);
		virtual void RankwiseSGD(double y_bar, PuzaSession s);
		virtual double RMSE(double y_bar, double r);
		virtual void PointwiseTrain(int iter);
		virtual void RankwiseTrain(int iter);
		virtual void PointwiseValidation(int iter);
		virtual void RankwiseValidation(int iter);
	public:
		PuzaLFM();
		virtual void TrainValidation();
		virtual ~PuzaLFM();
	};
};

#endif
